/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author gianmariospacagna
 */
@Entity
public class EntitySensor implements Serializable {
    @OneToMany(mappedBy="sensor",cascade={CascadeType.PERSIST})
    private List<EntitySample> entitySamples;
    private static final long serialVersionUID = 1L;
    @Id
    private String name;

    
   
    private String description;
    private int wasaId;
    private int dim;
    
    public String getName() {
        return name;
    }

    public void setName(String id) {
        this.name = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getDim() {
        return dim;
    }

    public void setDim(int dim) {
        this.dim = dim;
    }

   

    public int getWasaId() {
        return wasaId;
    }

    public void setWasaId(int wasaId) {
        this.wasaId = wasaId;
    }

    
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (name != null ? name.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the name fields are not set
        if (!(object instanceof EntitySensor)) {
            return false;
        }
        EntitySensor other = (EntitySensor) object;
        if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Database.EntitySensor[ id=" + name + " ]";
    }
    
}
